#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long
#define uint unsigned int

#define YES cout << "YES" << '\n'
#define NO cout << "NO" << '\n'
#define endl '\n'
const int INF = 1e9;
const int MOD = 998244353;
using namespace std;

/*思考

*/

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, k = 0, l, r;
    cin >> n;
    vector<int> a(n+1,0);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        a[i]+=a[i-1];
    }
    cin>>l>>r;
    for(int i=1;i<=n;i++){
        if(l<=a[i]&&a[i]<=r&&a[n]-a[i]<=r&&a[n]-a[i]>=l){
            cout<<i+1<<endl;
            return 0;
        }
    }
    cout<<0<<endl;
    return 0;
}